<template>
  <div class="back-button" @click="goBack">
    <i class="fa fa-arrow-left"></i> 返回
  </div>
</template>

<script>
import { useRouter } from 'vue-router';

export default {
  name: 'BackButton',
  setup() {
    const router = useRouter();
    const goBack = () => {
      router.back();
    };
    return { goBack };
  }
}
</script>

<style scoped>
.back-button {
  position: fixed;
  left: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 16px;
  color: #ffffff;
  z-index: 1100; /* 提高层级，确保在其他元素之上 */
}

.back-button i {
  margin-right: 5px;
}
</style>